1. Field of the Invention
The present invention relates to a long-hour video/audio compression device and a method thereof and, more particularly, to a compression and coding method for compressing and coding video and audio.
2. Description of the Related Art
In a case of digitization of videos and audio for the recording on a recording medium such as a CD-ROM or a hard disc, because the volume of their data is ordinarily enormous, the video and the audio are recorded after being subjected to compression and coding. Control for compression and coding and recording of videos and audio of this kind is realized by executing an application program.
As this compression and coding method, various kinds of compression and coding systems exist, among which relatively more often used is the coding system based on DCT (Discrete Cosine Transform) for conducting compression making the use of the nature that space frequencies of videos concentrate on low frequencies. The system is adopted as an international standard coding system such as the JPEG (Joint Photographic Expert Group), the MPEG (Moving Picture Expert Group) 1 or the MPEG 2.
In the following, conventional compression operation will be described with respect to the MPEG. First, structure of a video compression control unit is shown in FIG. 2. In FIG. 2, a video compression control unit 40 includes a YUV conversion unit 41 for converting an image to have a format of a color signal [YUV format: format in which a color signal is separated into a luminance signal (Y) and a color difference signal (Cb, Cr)] compressible by the MPEG, a motion searching unit 42 for searching each region of a block (16 pixels×16 pixels in MPEG) for motion of images in preceding/succeeding frames and a current frame, a DCT unit 43 for converting an image of a block into a space frequency, a quantization unit 44 for conducting quantization, an inverse quantization unit 47 for conducting inverse quantization for the restoration from quantization, an inverse DCT unit 46 for the restoration from frequency conversion, a motion compensating unit 45 for compensating for motion of an image on a block basis to generate a new reference frame and a variable-length coding unit 48 for conducting variable-length coding.
Image compression processing by the video compression control unit 40, as shown in FIG. 2, is realized by converting an original image from a capture or a file into YUV data by the YUV conversion unit 41 to conduct compression according to a kind of picture. In a case of an I picture [intra-coded picture (intra-frame coded frame)], YUV data is divided into blocks, converted into a space frequency on a block basis by the DCT unit 43 and quantized by the quantization unit 44, and then variable-length coded by the variable-length coding unit 48 to output a compressed code. In addition, a quantized block is inversely quantized by the inverse quantization unit 47 and inversely frequency-converted by the inverse DCT unit 46 to generate a reference frame.
In a case of a P picture [predictive-coded picture (inter-frame coded frame)], YUV data is divided into blocks to obtain a block having the highest correlation among blocks of a preceding frame stored as a reference frame by the motion searching unit 42 on a block basis and a difference from the block of the preceding frame having the highest correlation is converted into a space frequency by the DCT unit 43, quantized by the quantization unit 44 and then variable-length coded by the variable-length coding unit 48 to output a compressed code. In addition, a quantized block is inversely quantized by the inverse quantization unit 47, inversely frequency-converted by the inverse DCT unit 46 and then added to a block whose motion is compensated for by the motion compensating unit 45 to generate a reference frame.
In a case of a B picture [bidirectionally predictive-coded picture (intra-frame inserted coded frame)], YUV data is divided into blocks to obtain a block having the highest correlation among blocks of preceding/succeeding frames stored as a reference frame by the motion searching unit 42 on a block basis and a difference from the block of the preceding/succeeding frames having the highest correlation is converted into a space frequency by the DCT unit 43, quantized by the quantization unit 44 and then variable-length coded by the variable-length coding unit 48 to output a compressed code. In the case of a B picture, generation of a reference frame is unnecessary.
Next, structure of an audio compression control unit for conducting audio compression is shown in FIG. 3. In FIG. 3, an audio compression control unit 50 includes an original sound cut out unit 51 for cutting out original sound data of one AAU (Audio Access Unit) from an original sound, a 32 frequency bands mapping unit 52 for conducting frequency band mapping processing on an AAU basis, a quantization and coding unit 53 for conducting linear quantization and coding, a frame formation unit 54 for generating compressed data of one AAU by adding additional information to coded data and a psychological audition unit 55 for conducting psychological audition processing.
The audio compression processing by the audio compression control unit 50, as shown in FIG. 3, is realized by cutting out one AAU (1152 samples in a case of MPEG audio layer 2) from an original sound by the original sound cut out unit 51 and compressing the same on an AAU basis. The 32 frequency bands mapping unit 52 dissolves an input signal into sub band signals of 32 bands by a sub band analysis filter and calculates a scale factor of each sub band signal to equalize dynamic ranges.
The psychological audition unit 55 fast-Fourier-transforms an input signal and calculates a masking of psychological audition based on the conversion result to calculate bit assignment to each sub band. The quantization and coding unit 53 conducts quantization and coding according to the determined bit assignment. The frame formation unit 54 adds a header or subsidiary information to the quantized and coded sub band signal and shapes the signal into a bit stream to output the signal as a compressed code.
Shown in FIG. 4 is a structure of a system coding control unit for conducing system coding for multiplexing a video code and an audio code. In FIG. 4, a system coding control unit 60 includes a video pack generation unit 61 for packing a video code, an audio pack generation unit 62 for packing an audio code, a time stamp generation unit 63 for generating a time stamp to be inserted into a packet header and a padding pack generation unit 64 for generating a padding pack to be skipped by a decoder for the adjustment of a bit rate.
In system coding by the system coding control unit 60, as shown in FIG. 4, upon reception of a video code and an audio code, the unit 60 controls the video pack generation unit 61 and the audio pack generation unit 62 to output a system code. The video pack generation unit 61 cuts out data of a packet from the video code and adds a packet header and a pack header to the data. The audio pack generation unit 62 cuts out data of a packet from the audio code and adds a packet header and a pack header to the data.
At this time, in a case of a video code, when the head of a frame is contained in packet data, a PTS (Presentation Time Stamp) or a DTS (Decoding Time Stamp) generated at the time stamp generation unit 63 is inserted. In a case of an audio code, if the head of an AAU is contained in packet data, a PTS generated at the time stamp generation unit 63 is inserted. In addition, the padding pack generation unit 64 inserts a padding pack so as to have an average system bit rate.
Among such methods of compressing videos and audio as mentioned above is a method recited in Japanese Patent Laying-Open No. 2000-125257. In this method, compressed video/audio codes are written in a disk-type recording medium. Another method is recited in Japanese Patent Laying-Open No. 10-79671 which enables long-hour compression by changing a compression rate during recording operation.
While a volume of data can be reduced by compressing videos and audio as described above, when compression continues for hours even if a compression rate is high, the volume of data will become enormous. As a result, a system having an upper limit on a size of its producible file is not allowed to continue compression exceeding the upper limit when outputting a compressed code to a file.
Also even when reproducing only a part of a file compressed for hours by a reproduction device, one enormous file should be copied to cost labor.
Although only the solution of the above-described problems is dividing a compressed code into a plurality of files and outputting the same, simple division prevents a halfway file from becoming such an MPEG code as shown in FIGS. 5 to 7, so that reproduction is impossible by a standard reproduction device.